package cn.jiyun.mapper;

import cn.jiyun.pojo.Stage;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

public interface StageMapper {
    List<Map> findPage(int i, Integer pageSize, String queryString);

    @Delete("delete from stage where sid=#{sid}")
    int delete(Integer sid);

    @Insert("INSERT INTO `aniu_kaifa`.`stage` ( `sid`,  `sname`,  `starttime`,  `endtime`,  `pid`) VALUES (null,#{sname},#{starttime},#{endtime},#{pid})")
    int add(Stage stage);

    @Update("UPDATE  `aniu_kaifa`.`stage` SET  `sname` = #{sname},  `starttime` = #{starttime},  `endtime` = #{endtime},  `pid` = #{pid} WHERE `sid` = #{sid}")
    int edit(Stage stage);

    @Select("select * from stage where sid=#{sid}")
    List<Stage> findById(Integer sid);

    /*@Select("select * from stage")
    int jilu();*/


}
